import {Component, OnInit} from '@angular/core';
import {BladeService} from '../../../shared/blade.service';
import {BladeData} from '../../../shared/blade/blade-data';
import {ModelListComponent} from './model-list/model-list.component';
import {Observable} from 'rxjs/Observable';

@Component({
  selector: 'app-model',
  templateUrl: './model.component.html',
  styleUrls: ['./model.component.css'],
  providers: [BladeService]
})
export class ModelComponent implements OnInit {
  constructor(
    public bladeService: BladeService,
  ) {
  }

  ngOnInit() {
    this.createModelListtBlade();

  }

  createModelListtBlade() {
    let data: BladeData = new BladeData();
    data.id = 'modelList';
    data.title = '型号信息列表';
    data.isClosingDisabled = true;
    let modelListBlade = this.bladeService.createBlade(ModelListComponent, data);
    this.bladeService.showBlade(modelListBlade);
  }

  /**
   * 是否可以离开
   *
   *
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/model/model.component.ts
